{% load i18n %}
{% load promgen %}
<div class="panel-group">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h5>Users</h5>
    </div>
    <div class="panel-body">
      <table class="table table-bordered">
        <tr>
          <th>User</th>
          <th>Email</th>
          <th>Role</th>
          <th>Actions</th>
        </tr>
        {% for user,perms in object|get_users_roles %}
          {% include "promgen/permission_user_row.html" %}
        {% endfor %}
      </table>
    </div>
  </div>

  <div class="panel panel-default">
    <div class="panel-heading">
      <h5>Groups</h5>
    </div>
    <div class="panel-body">
      <table class="table table-bordered">
        <tr>
          <th>Name</th>
          <th>Role</th>
          <th>Actions</th>
        </tr>
        {% for group,perms in object|get_groups_roles %}
          {% include "promgen/permission_group_row.html" %}
        {% endfor %}
      </table>
    </div>
  </div>

  <div class="panel panel-footer">
    <div class="panel-heading">
      <h4>Grant Permissions</h4>
    </div>
    <div class="panel-body">{% include "promgen/permission_form.html" %}</div>
  </div>
</div>
